home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-08-29 | 2.0 KB | 75 lines | [TEXT/KAHL] |
- UNIT packet_format;
- INTERFACE
- type
-
- pf_byte=0..255; {packs to one byte}
- pf_word=0..$ffff; {packs to a word}
-
- { define a ddp short header}
- pf_DDP_short=packed record
- al_dest:pf_byte; {lap destination}
- al_src:pf_byte; {lap source}
- al_type:pf_byte; {lap type}
- len_flags:pf_word; {length and flags, use pf_lf_decode to unpack}
- dst_sok:pf_byte; {DDP destination socket}
- src_sok:pf_byte; {DDP source socket}
- ty:pf_byte; {DDP proticol type}
- end;
- pf_DDP_short_pt=^pf_DDP_short;
-
- { define a ddp long header}
- pf_DDP_long=packed record
- al_dest:pf_byte; {lap destination}
- al_src:pf_byte; {lap source}
- al_type:pf_byte; {lap type}
- len_flags:pf_word; {length and flags, use pf_lf_decode to unpack}
- cks:pf_word; {network checksum}
- dst_net:pf_word; {destination network}
- src_net:pf_word; {source network}
- dst_nod:pf_byte; {destination node id}
- src_nod:pf_byte; {source node id}
- dst_sok:pf_byte; {DDP destination socket}
- src_sok:pf_byte; {DDP source socket}
- ty:pf_byte; {DDP proticol type}
- end;
- pf_DDP_long_pt=^pf_DDP_long;
-
- pf_ddp_types=(pf_ddp_is_short,pf_ddp_is_long);
-
- {how to read a packet header, it may be just lap}
- {or lap and long or short ddp.}
- {since lap headers are an odd length they are duplicated}
- {at the front of each ddp so that they pack correctly}
- pf_some_ddp=packed record
- case pf_ddp_types of
- pf_ddp_is_short:(sddp:pf_DDP_short);
- pf_ddp_is_long:(lddp:pf_DDP_long);
- end;
-
- {decode the length/reserved bytes of a short ddp packet}
- procedure pf_lf_short_decode(
- pakwrd:pf_word; {the length/reserved word to unpack}
- var zro:pf_byte; {the reserved zero field}
- var len:bf_word; {the packet length)
- );
-
- {decode the length/hop/reserved bytes of long ddp packet}
- procedure pf_lf_long_decode(
- pakwrd:pf_word; {the length/reserved word to unpack}
- var zro:pf_byte; {the reserved zero field}
- var len:bf_word; {the packet length)
- var hop:bf_byte; {the packet hop count}
- );
-
- IMPLEMENTATION
-
- procedure pf_lf_long_decode;
- begin
- end;
-
- procedure pf_lf_short_decode;
- begin
- end;
-
- END.
-